﻿<Window x:Class="DemoApp.Window1"
		xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
		xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:s="clr-namespace:DiagramDesigner;assembly=DiagramDesigner"
        xmlns:local="clr-namespace:DemoApp"
        WindowState="Maximized"
        SnapsToDevicePixels="True"
		Title="Diagram Designer"        
		Height="850" Width="1100">
	

    <Window.InputBindings>
        <KeyBinding Key="Del"
                    Command="{Binding DeleteSelectedItemsCommand}" />
    </Window.InputBindings>
	
	<DockPanel Margin="0">
		<ToolBar Height="35" DockPanel.Dock="Top">
			<Button ToolTip="Create New Component"
                    Content="New Component"
					Margin="5,0,10,0"
                    Command="{Binding CreateNewDiagramCommand}"/>
            <Separator></Separator>
            <Button ToolTip="Save Component to File"
                    Content="Save"
                    Margin="10,0,5,0"
                    Command="{Binding SaveDiagramCommand}" />
            <Button ToolTip="Deposit Component to Cloud"
                    Content="Deposit"
                    Margin="5,0,10,0"
                    Command="{Binding StoreDiagramCommand}" />
            <Separator></Separator>
            <!--<ComboBox Margin="8,0,3,0"
                     Width="200"
                     ToolTip="Saved Diagrams"
                      SelectedItem="{Binding SavedDiagramId}"
                     ItemsSource="{Binding SavedDiagrams}"/>-->
            <Button ToolTip="Browse Component"
                    Content="Browse"
                    Margin="10,0,5,0"
                    Command="{Binding BrowseDiagramCommand}" />
            <Button ToolTip="Load Selected Component"
                    Content="Load"
                    Margin="5,0,5,0"
                    Command="{Binding LoadDiagramCommand}" />
            <Separator></Separator>
            <Button ToolTip="Load Component from Cloud"
                    Content="Load from Cloud"
                    Margin="5,0,5,0"
                    Command="{Binding LoadCloudCommand}" />
            <Label Margin="5,0,5,0"
                   VerticalAlignment="Center"
                   Content="{Binding FilePath}"
                   Foreground="Red"/>
            <ProgressBar Margin="0,0,0,0"
                    Visibility="{Binding Path=IsBusy, Converter={x:Static s:BoolToVisibilityConverter.Instance}}"
                    IsIndeterminate="True"
                    Width="150"
                    Height="20"
                    VerticalAlignment="Center" />
        </ToolBar>
		
		<Grid Margin="0,5,0,0">
			<Grid.ColumnDefinitions>
				<ColumnDefinition Width="230" />
				<ColumnDefinition />
			</Grid.ColumnDefinitions>

            <!-- ToolBox Control -->
            <local:ToolBoxControl Grid.Column="0"
                                  DataContext="{Binding ToolBoxViewModel}" />

            <GridSplitter Grid.Column="1"
						  HorizontalAlignment="Left"
						  VerticalAlignment="Stretch"
						  Background="Transparent"
						  Width="3" />
        
            <!-- Diagram Control -->
            <s:DiagramControl Grid.Column="1"
                                  DataContext="{Binding DiagramViewModel}"
                                  Margin="3,1,0,0" />
        </Grid>

        <Popup Name="dialogPopUp" StaysOpen="True" Placement="Center" MaxWidth="200">
            <Border>
                <Border.Background>
                    <LinearGradientBrush>
                        <GradientStop Color="AliceBlue" Offset="1"></GradientStop>
                        <GradientStop Color="LightBlue" Offset="0"></GradientStop>
                    </LinearGradientBrush>
                </Border.Background>
                <StackPanel Margin="5" Background="White">
                    <TextBlock Margin="10" TextWrapping="Wrap">Please enter your name.
                    </TextBlock>
                    <TextBox Name="txtName" Margin="10"></TextBox>
                    <StackPanel Orientation="Horizontal" Margin="10">
                        <Button Padding="3" Margin="0,0,5,0">OK</Button>
                        <Button Padding="3">Cancel</Button>
                    </StackPanel>
                </StackPanel>
            </Border>
        </Popup>
	</DockPanel>    
	
</Window>
